package org.ucas.kgraph.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import org.ucas.kgraph.dto.*;
import org.ucas.kgraph.entity.Account;
import org.ucas.kgraph.entity.Relation;
import org.ucas.kgraph.entity.RelationType;
import org.ucas.kgraph.entity.Schem;
import org.ucas.kgraph.entity.Term;
import org.ucas.kgraph.service.PermService;
import org.ucas.kgraph.service.RelationService;
import org.ucas.kgraph.service.RoleService;
import org.ucas.kgraph.service.SchemService;
import org.ucas.kgraph.utils.exception.BadRequestException;
import org.ucas.kgraph.utils.exception.ConflictException;
import org.ucas.kgraph.utils.exception.NotFoundException;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;

import javax.servlet.http.HttpServletRequest;

import java.io.IOException;
import java.util.List;
import java.util.Optional;

@RestController
public class PermController extends BaseController {

  @Autowired
  private PermService permService;
  
  
  
  
  @RequestMapping(value = "/perms/list",method = RequestMethod.GET)
  public ListDto<PermDto> roles(){
	  return ListDto.of(permService.listPermAll(),PermDto::of);
  }
  

}
